/**
 *  Copyright 2011 Marco Berri - marcoberri@gmail.com
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and limitations under the License.
 **/
package com.mbfasttrack.model;

import java.util.ArrayList;
import java.util.List;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;

/**
 * @author Marco Berri marcoberri@gmail.com http://tecnicume.blogspot.com
 */
@Document
public class TrackPoint implements Base {

    @Id
    @Indexed
    private String id;
    private List<Point> points = new ArrayList();


    /**
     * 
     */
    public TrackPoint() {
    }

    /**
     * 
     * @return
     */
    @Override
    public String toString() {
        return "TrackPoint [id=" + getId() + "]";
    }

    /**
     * @return the track
     */
    //public Track getTrack() {
      //  return track;
    //}

    /**
     * @param track the track to set
     */
    //public void setTrack(Track track) {
      //7  this.track = track;
   // }

    /**
     * @return the id
     */
    public String getId() {
        return id;
    }

    /**
     * @param id the id to set
     */
    public void setId(String id) {
        this.id = id;
    }

    /**
     * @return the points
     */
    public List<Point> getPoints() {
        return points;
    }

    /**
     * @param points the points to set
     */
    public void setPoints(List<Point> points) {
        this.points = points;
    }

    /**
     * 
     * @param point
     */
    public void addPoint(Point point) {
        if (this.points == null) {
            this.points = new ArrayList();
        }
        this.points.add(point);
    }
}
